load("@build_bazel_rules_android//android:rules.bzl", "android_library")

licenses(["notice"])

package(
    default_testonly = 1,
    default_visibility = ["//:__subpackages__"],
)

android_library(
    name = "ecdsa_test_util-android",
    srcs = ["EcdsaTestUtil.java"],
    deps = [
        ":signature_test_vector-android",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access-android",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception-android",
        "//src/main/java/com/google/crypto/tink/signature:ecdsa_parameters-android",
        "//src/main/java/com/google/crypto/tink/signature:ecdsa_private_key-android",
        "//src/main/java/com/google/crypto/tink/signature:ecdsa_public_key-android",
        "//src/main/java/com/google/crypto/tink/subtle:hex-android",
        "//src/main/java/com/google/crypto/tink/util:secret_big_integer-android",
    ],
)

android_library(
    name = "signature_test_vector-android",
    srcs = ["SignatureTestVector.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink/signature:signature_private_key-android",
        "//src/main/java/com/google/crypto/tink/util:bytes-android",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

java_library(
    name = "ecdsa_test_util",
    testonly = 1,
    srcs = ["EcdsaTestUtil.java"],
    deps = [
        ":signature_test_vector",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception",
        "//src/main/java/com/google/crypto/tink/signature:ecdsa_parameters",
        "//src/main/java/com/google/crypto/tink/signature:ecdsa_private_key",
        "//src/main/java/com/google/crypto/tink/signature:ecdsa_public_key",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/util:secret_big_integer",
    ],
)

java_library(
    name = "signature_test_vector",
    testonly = 1,
    srcs = ["SignatureTestVector.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink/signature:signature_private_key",
        "//src/main/java/com/google/crypto/tink/util:bytes",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

android_library(
    name = "rsa_ssa_pss_test_util-android",
    srcs = ["RsaSsaPssTestUtil.java"],
    deps = [
        ":signature_test_vector-android",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access-android",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception-android",
        "//src/main/java/com/google/crypto/tink/signature:rsa_ssa_pss_parameters-android",
        "//src/main/java/com/google/crypto/tink/signature:rsa_ssa_pss_private_key-android",
        "//src/main/java/com/google/crypto/tink/signature:rsa_ssa_pss_public_key-android",
        "//src/main/java/com/google/crypto/tink/subtle:base64-android",
        "//src/main/java/com/google/crypto/tink/subtle:hex-android",
        "//src/main/java/com/google/crypto/tink/util:secret_big_integer-android",
        "@maven//:com_google_code_findbugs_jsr305",
    ],
)

java_library(
    name = "rsa_ssa_pss_test_util",
    srcs = ["RsaSsaPssTestUtil.java"],
    deps = [
        ":signature_test_vector",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception",
        "//src/main/java/com/google/crypto/tink/signature:rsa_ssa_pss_parameters",
        "//src/main/java/com/google/crypto/tink/signature:rsa_ssa_pss_private_key",
        "//src/main/java/com/google/crypto/tink/signature:rsa_ssa_pss_public_key",
        "//src/main/java/com/google/crypto/tink/subtle:base64",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/util:secret_big_integer",
        "@maven//:com_google_code_findbugs_jsr305",
    ],
)

android_library(
    name = "rsa_ssa_pkcs1_test_util-android",
    srcs = ["RsaSsaPkcs1TestUtil.java"],
    deps = [
        ":signature_test_vector-android",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access-android",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception-android",
        "//src/main/java/com/google/crypto/tink/signature:rsa_ssa_pkcs1_parameters-android",
        "//src/main/java/com/google/crypto/tink/signature:rsa_ssa_pkcs1_private_key-android",
        "//src/main/java/com/google/crypto/tink/signature:rsa_ssa_pkcs1_public_key-android",
        "//src/main/java/com/google/crypto/tink/subtle:base64-android",
        "//src/main/java/com/google/crypto/tink/subtle:hex-android",
        "//src/main/java/com/google/crypto/tink/util:secret_big_integer-android",
        "@maven//:com_google_code_findbugs_jsr305",
    ],
)

java_library(
    name = "rsa_ssa_pkcs1_test_util",
    srcs = ["RsaSsaPkcs1TestUtil.java"],
    deps = [
        ":signature_test_vector",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception",
        "//src/main/java/com/google/crypto/tink/signature:rsa_ssa_pkcs1_parameters",
        "//src/main/java/com/google/crypto/tink/signature:rsa_ssa_pkcs1_private_key",
        "//src/main/java/com/google/crypto/tink/signature:rsa_ssa_pkcs1_public_key",
        "//src/main/java/com/google/crypto/tink/subtle:base64",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/util:secret_big_integer",
        "@maven//:com_google_code_findbugs_jsr305",
    ],
)

android_library(
    name = "ed25519_test_util-android",
    srcs = ["Ed25519TestUtil.java"],
    deps = [
        ":signature_test_vector-android",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access-android",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception-android",
        "//src/main/java/com/google/crypto/tink/signature:ed25519_parameters-android",
        "//src/main/java/com/google/crypto/tink/signature:ed25519_private_key-android",
        "//src/main/java/com/google/crypto/tink/signature:ed25519_public_key-android",
        "//src/main/java/com/google/crypto/tink/subtle:hex-android",
        "//src/main/java/com/google/crypto/tink/util:bytes-android",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes-android",
    ],
)

java_library(
    name = "ed25519_test_util",
    srcs = ["Ed25519TestUtil.java"],
    deps = [
        ":signature_test_vector",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception",
        "//src/main/java/com/google/crypto/tink/signature:ed25519_parameters",
        "//src/main/java/com/google/crypto/tink/signature:ed25519_private_key",
        "//src/main/java/com/google/crypto/tink/signature:ed25519_public_key",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/util:bytes",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
    ],
)

android_library(
    name = "legacy_public_key_sign_key_manager-android",
    srcs = ["LegacyPublicKeySignKeyManager.java"],
    deps = [
        ":legacy_public_key_verify_key_manager-android",
        "//proto:ed25519_java_proto_lite",
        "//proto:tink_java_proto_lite",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access-android",
        "//src/main/java/com/google/crypto/tink:private_key_manager-android",
        "//src/main/java/com/google/crypto/tink:public_key_sign-android",
        "//src/main/java/com/google/crypto/tink/signature:ed25519_private_key-android",
        "//src/main/java/com/google/crypto/tink/signature:ed25519_public_key-android",
        "//src/main/java/com/google/crypto/tink/subtle:ed25519_sign-android",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes-android",
        "@maven//:com_google_protobuf_protobuf_javalite",
    ],
)

android_library(
    name = "legacy_public_key_verify_key_manager-android",
    srcs = ["LegacyPublicKeyVerifyKeyManager.java"],
    deps = [
        "//proto:ed25519_java_proto_lite",
        "//proto:tink_java_proto_lite",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:key_manager-android",
        "//src/main/java/com/google/crypto/tink:public_key_verify-android",
        "//src/main/java/com/google/crypto/tink/signature:ed25519_public_key-android",
        "//src/main/java/com/google/crypto/tink/subtle:ed25519_verify-android",
        "//src/main/java/com/google/crypto/tink/util:bytes-android",
        "@maven//:com_google_protobuf_protobuf_javalite",
    ],
)

java_library(
    name = "legacy_public_key_sign_key_manager",
    srcs = ["LegacyPublicKeySignKeyManager.java"],
    deps = [
        ":legacy_public_key_verify_key_manager",
        "//proto:ed25519_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink:private_key_manager",
        "//src/main/java/com/google/crypto/tink:public_key_sign",
        "//src/main/java/com/google/crypto/tink/signature:ed25519_private_key",
        "//src/main/java/com/google/crypto/tink/signature:ed25519_public_key",
        "//src/main/java/com/google/crypto/tink/subtle:ed25519_sign",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_protobuf_protobuf_java",
    ],
)

java_library(
    name = "legacy_public_key_verify_key_manager",
    srcs = ["LegacyPublicKeyVerifyKeyManager.java"],
    deps = [
        "//proto:ed25519_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:key_manager",
        "//src/main/java/com/google/crypto/tink:public_key_verify",
        "//src/main/java/com/google/crypto/tink/signature:ed25519_public_key",
        "//src/main/java/com/google/crypto/tink/subtle:ed25519_verify",
        "//src/main/java/com/google/crypto/tink/util:bytes",
        "@maven//:com_google_protobuf_protobuf_java",
    ],
)
